﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Security;
using System.Web;
using IHISCETeim.Library;
using IHISCETeim.Model;
using IHISCETeim.DAL;
using System.Data;
using System.Threading;
namespace IHISCETeim.BLL
{
    public  class PToolingChargeController
    {
        public static int IsExist(string ItemCode)
        {
            return PToolingChargeDAL.IsExist(ItemCode);
        }
        public static int Add(PToolingChargeInfo obj)
        {
            return PToolingChargeDAL.Add(obj);
        }
        public static int AddDetail(int PTCID, string ItemCode, string ItemName)
        {
            return PToolingChargeDAL.AddDetail(PTCID, ItemCode, ItemName);
        }
        public static bool Delete(int ID)
        {
            return PToolingChargeDAL.Delete(ID);
        }
        public static PToolingChargeInfo GetById(int ID)
        {
            return CBO.FillObject<PToolingChargeInfo>( PToolingChargeDAL.GetById(ID));
        }
        public static DataTable GetPagination(string WhereSql, int PageIndex, int PageSize, string Sort, ref int TotalCount)
        {
            return PToolingChargeDAL.GetPagination(WhereSql,  PageIndex, PageSize, Sort, ref  TotalCount);
        }
        public static bool Update(PToolingChargeInfo obj)
        {
            return PToolingChargeDAL.Update(obj);
        }

        /// <summary>
        /// 获取所有需提示的分摊项
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public static List<PToolingChargeInfo> GetExpireList()
        {
            return CBO.FillCollection<PToolingChargeInfo>(PToolingChargeDAL.GetExpireList());
        }
    }
}
